/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.util.ArrayList;
import javax.swing.DefaultComboBoxModel;

/**
 *
 * @author Jeferson
 */
public class CBPastaModel extends DefaultComboBoxModel{
    
    private ArrayList<String> pastas = new ArrayList<String>();

    public CBPastaModel(ArrayList<String> pastas) {
        this.pastas = pastas;
    }
    
    public CBPastaModel() {
    }
    
    public void addPasta(String pasta){
        pastas.add(pasta);
    }
    
    public String getPasta(int index){
        return pastas.get(index-1);
    }

    @Override
    public int getSize() {
        return pastas.size()+1;
    }

    @Override
    public Object getElementAt(int index) {
        if(index==0)
            return "Todas as Pastas";
        return pastas.get(index-1);
    }

    @Override
    public int getIndexOf(Object anObject) {
        return pastas.indexOf(anObject);
    }
    
    
    
    
    
    
    
}
